﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Avatar.BLL;
using Avatar.Management;
using Avatar.Common;

public partial class Main : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            try
            {
                var _information = SiteInformationManager.GetSiteInformation();
                if (_information != null)
                {
                    if (!string.IsNullOrEmpty(Page.Title))
                    {
                        Page.Title = (_information.Title + " - " + Page.Title).Trim();
                    }
                    else
                    {
                        Page.Title = _information.Title.Trim();
                    }

                    HtmlMeta _desc = new HtmlMeta();
                    _desc.Name = "Description";
                    _desc.Content = _information.Description.Trim();
                    Page.Header.Controls.Add(_desc);

                    HtmlMeta _keyWord = new HtmlMeta();
                    _keyWord.Name = "KeyWords";
                    _keyWord.Content = _information.KeyWord.Trim();
                    Page.Header.Controls.Add(_keyWord);

                }
                else
                {
                    Page.Title = "请登录后台设置网站基本信息";
                }
            }
            catch (Exception _e)
            {
                Helper.ShowMassage(_e.Message);
            }
        }
    }
}
